package com.umeng.soexample.mvp.view.custom;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Button;

import com.umeng.soexample.R;


@SuppressLint("AppCompatCustomView")
public class CreateOrderButton extends Button {

    public CreateOrderButton(Context context) {
        super(context);
    }

    public CreateOrderButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CreateOrderButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @SuppressLint("NewApi")
    public CreateOrderButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()){
            case MotionEvent.ACTION_DOWN:
                setBackgroundResource(R.drawable.paydone_success_black_bg);
                break;
            case MotionEvent.ACTION_MOVE:
                break;
            case MotionEvent.ACTION_UP:
                setBackgroundResource(R.drawable.js_common_images_btnsemptyp);
                break;
        }
        return super.onTouchEvent(event);
    }
}
